import { _ } from "@atinc/chaos";
import * as moment from 'moment';
const jwt = require('jsonwebtoken');
describe('test base', function () {
    it('should ', function () {
        const success = new test().success();
        console.log(success);

    });
    it('should aa', async function () {
        const a = {
            title: "not exist test_library_id",
            args:  (() => {
                let badReqBody = _.cloneDeep({
                    test_library_id: undefined
                });
                badReqBody.test_library_id = _.createId().toString();
                return badReqBody;
            })(),
            expected: {code: "100600", message: "测试库不存在或无权限访问"}
        };
        console.log(a);
    });

    it('test symbol', function () {
        const a: symbol = Symbol("a");
        console.log(a);
        console.log(a.valueOf());
        console.log(a.toString());
        console.log(a.description);

    });

    it('test moment', function () {
        let number = moment().add(-3,"d").format();
        console.log(number);
        console.log(new Date().getTime());
    });

    it('token test', function () {
        let sign = jwt.sign({
            "issuer": 70,
            "broad": "project",
            "ids": ["612ef12d66d22e27700f4c31"],
            "authenticator": 140,
            "team": "6099fcb992e1d81c91c11b8c",
            "uid": "32f0669e21e44938ba1b45ac77e52ca3",
            "iat": 1667272427,
            "exp": 1687279627
        },"26bff7a5-0134-49a0-a84e-9102d79829a8");
        console.log(sign);
    });

    it('test map', function () {

        let map = new Map();
        console.log(_.isEmpty(map));
        map.set("A","a");
        console.log(_.isEmpty(map));

    });
});

export class test {
    public name: string;

    public success() {
        this.name = "w";
        Reflect.defineProperty(this, "b", "b");
        return this;
    }
}